home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 4.7 KB | 159 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Content.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CONTENT_H
- #define CONTENT_H
-
- // ----- FrameWork Includes -----
-
- #ifndef FWCONTNG_H
- #include "FWContng.h"
- #endif
-
- #ifndef FWSCPTBL_H
- #include "FWScptbl.h"
- #endif
-
- #ifndef BASESHP_H
- #include "BaseShp.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class CDrawPart;
- class CShapeCollection;
- class CProxyShape;
-
- //========================================================================================
- // class CDrawContent
- //========================================================================================
-
- class CDrawContent : public FW_CEmbeddingContent
- {
- public:
- friend class CDrawContentShapeIterator;
- friend class CSemanticShapeElementIterator;
- friend class CAllShapeIterator;
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- FW_DECLARE_AUTO(CDrawContent)
-
- CDrawContent(Environment* ev, CDrawPart* part);
- CDrawContent(Environment* ev, CDrawContent* other);
-
- virtual ~CDrawContent();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_MProxy* IsDataOnlyOneProxy(Environment* ev) const;
-
- //----------------------------------------------------------------------------------------
- // Overridable API
- //
- public:
- virtual FW_Boolean IsOKtoWrite(Environment* ev, CBaseShape* shape);
- virtual void PostInternalizeShape(Environment* ev, const FW_CPoint& offset, CBaseShape* shape, short index);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- CProxyShape* AddSingleEmbeddedFrame(Environment* ev,
- FW_CEmbeddingFrame* scopeFrame,
- ODPart* odEmbeddedPart,
- ODFrame* odEmbeddedFrame,
- ODShape* suggestedShape,
- ODTypeToken viewType);
-
- void ExternalizeShapeList(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo,
- FW_Fixed offsetX,
- FW_Fixed offsetY);
- void InternalizeShapeList(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
-
- void AddShape(Environment* ev, CBaseShape* shape, CBaseShape* nextShape=NULL);
- void RemoveShape(Environment* ev, CBaseShape* shape);
-
- void EmptyShapes(Environment* ev);
-
- ODShape* CalcUpdateShape(Environment* ev);
- void OffsetShapes(Environment* ev, const FW_CPoint& offset);
- void RedrawShapes(Environment* ev);
- void RedrawShape(Environment* ev, CBaseShape* shape);
- void RedrawShape(Environment* ev, ODShape* odShape);
-
- //----------------------------------------------------------------------------------------
- // Getters & Setters
- //
- public:
- unsigned long CountShapes() const;
- FW_Boolean IsEmpty() const;
-
- CBaseShape* GetFirstShape() const;
- CBaseShape* GetShapeAfter(CBaseShape* shape) const;
-
- unsigned short GetProxyShapeCount() const
- {return fProxyShapeCount;}
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- CShapeCollection* fShapeList; // list of CBaseShape*
- CDrawPart* fDrawPart;
- unsigned short fProxyShapeCount;
- };
-
- //========================================================================================
- // class CDrawContentShapeIterator
- //========================================================================================
-
- class CDrawContentShapeIterator : public CShapeCollectionIterator
- {
- public:
- FW_DECLARE_AUTO(CDrawContentShapeIterator)
-
- public:
- CDrawContentShapeIterator(CDrawContent* content);
- ~CDrawContentShapeIterator();
- };
-
- //========================================================================================
- // class CSemanticShapeElementIterator
- //========================================================================================
-
- class CSemanticShapeElementIterator : public FW_CElementIterator
- {
- public:
- FW_DECLARE_AUTO(CSemanticShapeElementIterator)
-
- CSemanticShapeElementIterator(CDrawContent* content);
- ~CSemanticShapeElementIterator();
-
- virtual FW_MScriptable* First() { return fImplementation.First(); }
- virtual FW_MScriptable* Next() { return fImplementation.Next(); }
- virtual Boolean IsNotComplete() { return fImplementation.IsNotComplete(); }
-
- private:
- CShapeCollectionIterator fImplementation;
- };
-
- #endif
-